@import '../../../styles/constants';

$sidenav-width: 240px;

app-component-sidenav {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.docs-component-viewer-sidenav-container {
  flex: 1;
  box-sizing: border-box;
}

.docs-component-viewer-sidenav {
  overflow: auto;
}

.docs-component-sidenav-inner-content {
  display: flex;
  flex-direction: row;

  // The rule will match the element following the router-outlet which will be the routed component.
  router-outlet + * {
    flex-grow: 1;
    overflow: hidden;
  }
}

.mat-drawer {
  &::-webkit-scrollbar {
    height: 4px;
    width: 4px;
  }
}

.docs-component-viewer-nav {
  position: sticky;
  top: 0;

  .docs-component-viewer-nav-content {
    width: $sidenav-width;
    height: 100vh;
    overflow: auto;

    &::-webkit-scrollbar {
      height: 4px;
      width: 4px;
    }

    ul {
      list-style-type: none;
      margin: 0 0 5px 0;
      padding: 0;
      overflow: hidden;
    }

    li {
      font-size: 13px;
      line-height: 16px;
      margin: 0;
      padding: 5px 15px 5px 20px;
    }

    a {
      display: block;
      text-decoration: none;
    }
  }
}

.docs-component-sidenav-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.docs-component-sidenav-inner-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.docs-component-sidenav-body-content {
  display: flex;
  flex: 1 1 auto;
}

div .mat-list-base {
  padding-top: 0;
}

div.docs-component-viewer-nav-content .mat-nav-list .mat-list-item .mat-list-item-content {
  padding-left: 25px;
}

@media (max-width: $small-breakpoint-width) {
  // Add specific rule to prevent default rule conflict
  .docs-component-viewer-sidenav-container .docs-component-viewer-sidenav {
    // position right above the content
    z-index: 4;
  }

  .docs-component-viewer-nav {
    position: relative;
    top: 0;

    .docs-component-viewer-nav-content {
      box-sizing: border-box;
      margin: 0;
      max-height: initial;
    }
  }
}

@media (max-width: 720px) {
  .docs-component-viewer-sidenav-container {
    flex: 1 0 auto;
  }

  .docs-component-sidenav-body-content {
    flex-direction: column;
  }
}
